-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix a panic in Postgres revision parsing for incompatible ZedTokens #1540
Conversation
Are "we" sure it's a size issue, rather than an in our case, the similarly sized |
Yeah, its a capacity failure on trying to create a slice to track the revisions. The panic occurs on a |
The failing token So if it's a size issue, we'd expect |
If Postgres is passed a ZedToken from CRDB, it will (incorrectly) interpret the token and try to create a slice with too much capacity. This change caps the delta on the transaction IDs and returns an error in that scenario Fixes authzed#1539
9c685f9
to
5ea2da6
Compare
We would, except the lack of a decimal point means that it is interpreted as size In the case of the first revision given, This is all because legacy Postgres revisions were stored in this particular format, and giving a CRDB revision that "just so happened" to hit the legacy parsing code perfectly |
Ah, interesting on the postgres history, ty. so here the second part of the decimal timestamp is correctly being parsed as an xmin candidate, and correctly assigned to xmin on L208, as if it was a postgres revision. it's correct then to return the error after calculating the range, not dismiss the float timestamp sooner. thanks again! |
If Postgres is passed a ZedToken from CRDB, it will (incorrectly) interpret the token and try to create a slice with too much capacity. This change caps the delta on the transaction IDs and returns an error in that scenario
Fixes #1539